#!/bin/bash

tmp_file=$(mktemp)
while read -r line; do
    echo "$line" >> $tmp_file
done

if [ -z "$VIM_SERVER_NAME" ]; then
    echo "VIM_SERVER_NAME is not defined, exit..."
    exit 1
fi

vim --servername $VIM_SERVER_NAME --remote-tab $tmp_file
